package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    /**
     * 查询购物车中的数据
     * @param shoppingCart
     */
    List<ShoppingCart> listShoppingCart(ShoppingCart shoppingCart);

    /**
     * 更新商品数量
     * @param shoppingCart
     */
    void updateNumber(ShoppingCart shoppingCart);

    /**
     * 向购物车插入数据
     * @param shoppingCart
     */
    void addData(ShoppingCart shoppingCart);

    /**
     * 清空购物车
     * @param userId
     */
    void deleteShoppingCart(Long userId);

    /**
     * 批量插入购物车数据
     * @param shoppingCarts
     */
    void insertBatch(List<ShoppingCart> shoppingCarts);
}
